package net.sf.borg.control.systemLogin;

import net.sf.borg.model.db.jdbc.SystemDB;

/**
 * Interface LoginSystem
 *
 * Provides methods that should be used for any
 * type of login system.  Allows the state of the
 * login system to be set (new user, existing user, etc),
 *  the database for this system to be set, the currently
 *  entered username to be queried, and the ability to
 *  run the login system
 *
 * BORG/Open Source Information here.
 *
 * Created in UF Software Engineering - Summer 2009
 * @author Matthew Carroll
 */
public interface LoginSystem {

	enum LoginState { NEWUSER, CHOOSEUSER, AUTOMATIC }
	
	/* 
	 * Returns true if the client has been validated as a User, false otherwise
	 * 
	 * This is a blocking call and will return only after user input.  Upon success
	 * the global database path will be set to the logged in user's database.
	 */
	boolean runLogin();
	
	/*
	 * Returns username after successful login.
	 */
	String getUsername();
	
	void setDB(SystemDB db);
	
	void setLoginState(LoginState state);
}
